package com.alogic.terminal.ssh.auth;

import ch.ethz.ssh2.Connection;
import com.alogic.terminal.ssh.Authenticator;
import com.anysoft.util.Configurable;
import com.anysoft.util.Properties;
import com.anysoft.util.PropertiesConstants;
import java.io.IOException;

/**
 * None登录方式
 */
public class None implements Authenticator, Configurable {

    private String username;

    @Override
    public boolean authenticate(Connection conn) throws IOException {
        return conn.authenticateWithNone(username);
    }

    @Override
    public void configure(Properties p) {
        username = PropertiesConstants.getString(p,"username","");
    }
}
